/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package systole.view.tabs.controllers;

/**
 *
 * @author jmj
 */
public class SelectionItem implements Cloneable {

    private int indexSegement;
    private boolean selected;

    /**
     * @param indexSegement
     */
    public SelectionItem(int indexSegement) {
        this.indexSegement = indexSegement;
        this.selected = false;
    }

    /**
     *
     * @param indexSegement
     * @param selected
     */
    public SelectionItem(int indexSegement, boolean selected) {
        this.indexSegement = indexSegement;
        this.selected = selected;
    }

    /**
     * @return the indexSegement
     */
    public int getIndexSegement() {
        return indexSegement;
    }

    /**
     * @param indexSegement the indexSegement to set
     */
    public void setIndexSegement(int indexSegement) {
        this.indexSegement = indexSegement;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final SelectionItem other = (SelectionItem) obj;
        if (this.indexSegement != other.indexSegement) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 41 * hash + this.indexSegement;
        hash = 41 * hash + (this.selected ? 1 : 0);
        return hash;
    }

    /**
     * @return the selected
     */
    public boolean isSelected() {
        return selected;
    }

    /**
     * @param selected the selected to set
     */
    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    @Override
    protected Object clone() {
        return new SelectionItem(this.indexSegement, this.selected);
    }
}
